package com.lhn.service.impl;

import com.lhn.entity.Menu;
import com.lhn.mapper.MenuMapper;
import com.lhn.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lhn
 * @date 2024-10-09 14:56
 */

@Service
public class MenuServiceImpl implements MenuService {

    @Autowired
    private MenuMapper menuMapper;

    @Override
    public List<Menu> findAll(int index, int limit) {
//        System.out.println("this is menu service impl findAll");
        return menuMapper.findAll(index, limit);
    }

    @Override
    public List<Menu> findAllWithType(int index, int limit) {
        return menuMapper.findAllWithType(index, limit);
    }

    @Override
    public int count() {
        return menuMapper.count();
    }

    @Override
    public Menu findById(long id) {
        return menuMapper.findById(id);
    }

    @Override
    public void save(Menu menu) {
        menuMapper.save(menu);
    }

    @Override
    public void update(Menu menu) {
        menuMapper.update(menu);
    }

    @Override
    public void deleteById(long id) {
        menuMapper.deleteById(id);
    }

}
